package week12.chat;

import java.util.Objects;

/**
 * @author The setting sun
 * @version 1.0
 * @title: Account
 * @description: TODO
 * @date 2021/11/25 9:23
 */
public class Account {
    private int userID;
    private String account;
    private String password;

    public Account() {
    }

    public Account(int userID, String account, String password) {
        this.userID = userID;
        this.account = account;
        this.password = password;
    }

    public int getUserID() {
        return userID;
    }

    public void setUserID(int userID) {
        this.userID = userID;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Account account1 = (Account) o;
        return userID == account1.userID && Objects.equals(account, account1.account) && Objects.equals(password, account1.password);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userID, account, password);
    }

    @Override
    public String toString() {
        return "Account{" +
                "userID=" + userID +
                ", account='" + account + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
